home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 684 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  47 lines

  1. Newsgroups: comp.lang.c
  2. Path: newshub.ariel.cs.yorku.ca!cs911319
  3. From: cs911319@ariel.cs.yorku.ca (STEPHEN HOI CHI KONG)
  4. Subject: Re: how do i...
  5. X-Nntp-Posting-Host: red
  6. Message-ID: <DKvC14.Ft6@ariel.cs.yorku.ca>
  7. Sender: news@ariel.cs.yorku.ca (*)
  8. Organization: York University, Dept. of Computer Science
  9. References: <4cl4ja$558@news-e2a.gnn.com>
  10. Date: Mon, 8 Jan 1996 15:22:16 GMT
  11.  
  12. In article <4cl4ja$558@news-e2a.gnn.com> MrBurns@gnn.com (Kevin Kalstein) writes:
  13. >hi all.  i wrote an address book that saves addresses to disk
  14. >with a .adr extension.  i want to create a feature that allows
  15. >the user to see the .adr files in the directory.  basically
  16. >what im looking for is a command that will let me do the dos
  17. >equivalent of "dir *.adr".  unfortunately i cant find any
  18. >commands to do this.  im using borland c++ version 3.0.
  19. >(note this program is written in C not C++).  any help would
  20. >be greatly appreciated. 
  21.  
  22.     I believe you have two ways to do it.
  23.  
  24. 1.) write a batch file as follow:
  25.  
  26. REM listadr.bat
  27. REM put this batch file into DOS\ directory
  28. REM usage C:\>listadr <enter>
  29. @echo off
  30. dir *.adr /w
  31.  
  32. 2.) using 'system()' library function in C
  33.  
  34. #include <stdlib.h>
  35.  
  36. i.e.  system ("dir *.adr/w"); /* puts this statement in your C program */
  37.  
  38.  
  39.     I hope these help. 
  40.  
  41.                             Zollen
  42.  
  43.  
  44.  
  45.  
  46.  
  47.